home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
TPUG - Toronto PET Users Group
/
TPUG Users Group CD
/
TPUG Users Group CD.iso
/
CRS
/
crs66.d81
/
format.seq
< prev
next >
Wrap
Text File
|
2009-10-10
|
5KB
|
130 lines
╟┼╧╨┴╔╬╘ ╞╔╠┼ ╞╧╥═┴╘
├ARDS AND COLOR ON THE C64 (BACKGROUND).
╘HE GRAPHICS MODE USED BY ╟┼╧╙ ON THE C64 SUPPORTS 320 BY
200 RESOLUTION, ORGANIZED AS A 40 BY 25 MATRIX OF 8 BY 8
PIXEL CARDS. ╘HESE CARDS ARE STORED IN THE FRAME BUFFER
FROM LEFT TO RIGHT, TOP TO BOTTOM. ╘HE DIAGRAM BELOW
BETTER ILLUSTRATES THIS FORMAT.
╧╬ ╙├╥┼┼╬:
CARD0 CARD1 CARD2 ... CARD39
CARD40 CARD41 CARD42 ... CARD79
.
.
CARD960 CARD961 CARD962 ... CARD999
┼┴├╚ ├┴╥─: BYTE0
BYTE1
...
BYTE6
BYTE7
┼ACH BYTE CONTAINS 8 BITS, 1 PER PIXEL ON THE SCREEN.
╘HESE EIGHT BYTES MAKE UP AN 8 BY 8 PIXEL IMAGE.
╔╬ ╞╥┴═┼ ┬╒╞╞┼╥:
├┴╥─0 ├┴╥─1 ├┴╥─2
├┴╥─ ╥╧╫ 0 -> BYTE0 BYTE8 BYTE 16
... ... ...
BYTE7 BYTE15 BYTE23
├┴╥─40 ├┴╥─41 ├┴╥─42
├┴╥─ ╥╧╫ 1 -> BYTE320 BYTE328 BYTE336
... ... ...
BYTE327 BYTE335 BYTE443
╘HIS GRAPHICS MODE SUPPORTS 16 COLORS, BUT THE COLOR
RESOLUTION IS LIMITED TO CARD BOUNDARIES. ╘HAT IS, TWO
COLORS CAN BE SPECIFIED FOR EACH CARD ON THE SCREEN -- A
BACKGROUND COLOR (BITS SET TO 0 IN THE CARD) AND A
FOREGROUND COLOR (BITS SET TO 1 IN THE CARD). ╘HIS COLOR
INFORMATION IS STORED SEPARATELY FROM THE FRAME BUFFER,
ONE BYTE PER CARD. ╘HE HIGH 4 BITS IN THE BYTE SPECIFY
ONE OF 16 COLORS TO BE USED FOR THE FOREGROUND, AND THE
LOW FOUR BITS SPECIFY THE BACKGROUND COLOR.
╟┼╧╨┴╔╬╘ ╞╔╠┼ ╞╧╥═┴╘
-------- ---- ------
┴ GEO╨AINT DATA FILE IS A ╓╠╔╥ FILE WITH 45 RECORDS.
(╞OR INFO ON WHAT A ╓╠╔╥ FILE IS, SEE THE ╟┼╧╙ ╨ROGRAMMER'S
╥EFERENCE ═ANUAL). ┼ACH RECORD HOLDS THE IMAGE AND COLOR
DATA FOR AN AREA OF THE PAGE 16 LINES HIGH BY 640 PIXELS
WIDE. ┴ GEO╨AINT DOCUMENT IS 720 LINES HIGH BY 640 PIXELS
WIDE, SO EACH RECORD REPRESENTS TWO CARD ROWS OF THE
ENTIRE DOCUMENT. ╘HE IMAGE DATA IS STORED IN THE SAME
CARD FORMAT USED BY THE 320 BY 200 GRAPHICS MODE ON THE
C64, DISCUSSED ABOVE.
╫HEN A GEO╨AINT FILE IS CREATED, ALL 45 RECORDS ARE
MARKED AS USED IN THE INDEX TABLE OF THE ╓╠╔╥ FILE. ╘HE
TRACK AND SECTOR POINTERS ARE SET TO $00,$╞╞ TO INDICATE
AN EMPTY RECORD; INSTEAD OF $00,$00 WHICH INDICATES AN
UNUSED RECORD.
╘HE 45 RECORDS ARE ASSIGNED TO ALTERNATE CARD ROWS,
FROM TOP TO BOTTOM ON THE DOCUMENT. ╘HAT IS, RECORD 0
CONTAINS THE IMAGE AND COLOR DATA FOR CARD ROWS 0 AND 1;
RECORD 1 FOR CARD ROWS 2 AND 3, ETC.
╘HE IMAGE AND COLOR INFO IS COMPACTED BEFORE BEING
WRITTEN TO THE RECORD. ╘HE PRE-COMPACTED LAYOUT OF THE
DATA IS:
#BYTES START/END ($) DESCRIPTION
------ ------------- -----------
640 000 - 27╞ IMAGE DATA FOR
1ST CARD ROW
640 280 - 4╞╞ IMAGE DATA FOR
2ND CARD ROW
8 500 - 507 ALL ZEROES.
80 508 - 557 COLOR INFO FOR
FIRST CARD ROW
80 558 - 5┴7 COLOR INFO FOR
2ND CARD ROW
╘HE EIGHT BYTES OF ZERO WERE INCLUDED IN GEO╨AINT 1.0
FILES THROUGH AN OVERSIGHT, AND RETAINED AFTER THAT FOR
COMPATABILITY.
├╧═╨┴├╘╔╧╬ ╞╧╥═┴╘
---------- ------
╘HE COMPACTION ROUTINE OPERATES ON THE ENTIRE 1448
BYTES AT ONCE, RESULTING IN A STRING OF BYTES IN THE
FOLLOWING FORMAT.
---------------------
! COMMAND/COUNT ! DATA !
! BYTE ! BYTE !
--------------------- ......
╫HERE THERE IS ONE COMMAND/COUNT BYTE, AND FROM 1 TO
63 DATA BYTES. ╘HIS PATTERN IS REPEATED UNTIL ALL 1448
BYTES ARE REPRESENTED. ╘HE COMMAND/COUNT BYTE IS
INTERPRETED AS FOLLOWS:
HEX VALUE INTERPRETATION
--------- --------------
$00 ┼ND OF RECORD
$01 - $3╞ ╒SE COMMAND BYTE AS ├╧╒╬╘.
╘HE FOLLOWING ├╧╒╬╘ DATA
BYTES ARE UNCOMPACTED.
$40 ╔NVALID COMMAND BYTE.
$41 - $7╞ ╙UBTRACT $40 FROM THE
COMMAND BYTE, USE THE
RESULT AS ├╧╒╬╘. ╘HE NEXT
8 DATA BYTES COMPRISE A
CARD TO REPEAT ├╧╒╬╘ TIMES.
╘HESE 8 DATA BYTES EXPAND
TO 8*├╧╒╬╘ IMAGE BYTES.
$80 ╔NVALID COMMAND BYTE.
$81 - $╞╞ ╙UBTRACT $80 FROM THE
COMMAND BYTE, USE THE
RESULT AS ├╧╒╬╘. ╥EPEAT THE
SINGLE DATA BYTE THAT
FOLLOWS ├╧╒╬╘ TIMES. ╘HIS
SINGLE BYTE EXPANDS TO
├╧╒╬╘ IMAGE BYTES.